<template>
  <view class="container">

    <u-card :title="activityName">
      <view class="" slot="body">
        <view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
          <u-image :src="imageUrl" width="100%" height="320px" mode="aspectFit"></u-image>
        </view>
        <view v-if="publicityImage" class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
          <u-image :src="publicityImage" width="100%" height="320px" mode="aspectFit"></u-image>
        </view>
      </view>
      <view class="" slot="foot">
        <view class="tip-wrapper">
          <u-icon name="chat-fill" size="34" color=""></u-icon>
          <text class="tip">{{ activityText }}</text>
        </view>
      </view>
    </u-card>

  </view>
</template>

<script>
import {mapGetters} from "vuex";

export default {
  data() {
    return {
      imageUrl: null,
      activityText: "",
      activityName: "",
      iframePath: "",
      isShowGuide: false,
      isShowGuide1: false,
      // 宣传图片
      publicityImage: null
    };
  },
  mounted() {
    this.updateParticipateActivity();
    this.getActivitys();
  },
  computed: {
    ...mapGetters(["deptId", "stepType"]),
  },
  methods: {
    async getActivitys() {
      let {data} = await this.$api.activity.getActivity({companyId: this.deptId});
      this.imageUrl = data.imageUrl
      this.activityText = data.activityText
      this.activityName = data.activityName
      this.publicityImage = data.publicityImage
    },
    async updateParticipateActivity() {
      await this.$api.activity.updateParticipateActivity();
    },
    curIndex(num) {
      if (num === 2 || num === 3) {
        this.isShowGuide1 = true;
      } else {
        this.isShowGuide1 = false;
      }
      if (num === 1) {
        this.isShowGuide = true;
      } else {
        this.isShowGuide = false;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;

  .tip-wrapper {
    display: flex;
    align-items: center;
    .tip {
      font-size: 40rpx;
      margin-left: 2px;
      color: #1F2F3D;
      font-weight: bold;
    }
  }

}
</style>
